<% include head %>	
		<style>
			.index{
				width: 300px;
				margin: 0 auto;
			}
			p{

				padding:10px;
				color: white;
				background: orangered;
				text-align: center;
				border-radius: 10px;
				cursor: pointer;
			}
			input{
				margin-top: 50px;
				border:  solid 1px #eee;
				width: 100%;
				line-height: 27px;
				padding: 0 10px;
				margin-bottom: 10px;
			}
		</style>
		<div class="index">
			<span>谨慎该操作！！！</span>
			<input autofocus placeholder="请输入安全密码" type="text">
			<p>清空数据库</p>
		</div>

<script>
	$('p').click(function () {

	    var pwd = $('input').val().trim();

	    if(pwd == ''){
	        alert('请输入口令')
	        return;
		}

		$.get('/guanli/clearDatabase?pwd='+pwd).then((result)=>{
		    if(result == 'success'){
		        alert('数据库已清空！');

			}else{
		        alert(result)
			}
		}).catch((err)=>{
		    console.log(err);
		})
    })
</script>

<% include foot %>	